using System;
using System.Data;
using System.Configuration;
using System.Collections.Generic;
using CMS.Core.DataInterfaces;
using CMS.Core.Domain;
using CMS.Data;
using AjaxPro;

namespace CMS.Presenters
{
    public class SelectNguoiGuiPresenter
    {
        private ISelectDiaBanView view;
        IDiaBanDao dbDao;
       
        //Attaches this presenter to the view's events.
        public SelectNguoiGuiPresenter(ISelectDiaBanView view)
        {
            this.view = view;
            this.dbDao = new DiaBanDao();
            LoadViewFromModel();
            //SubscribeViewToEvents();
        }

        public SelectNguoiGuiPresenter()
        {
           
        }

        //void SubscribeViewToEvents()
        //{
        //    view.Load += OnViewLoad;
        //}

        //void OnViewLoad(object sender, EventArgs e)
        //{
        //    if (!view.IsPostBack)
        //    {
        //        LoadViewFromModel();
        //    }
        //}

        void LoadViewFromModel()
        {
            //this.dbDao.GetAllWithMoreFieldsAndOderBy(true, new string[] {}
            view.DiaBanList = this.dbDao.GetFieldEqualCriteria("TrangThai", true);
            //this.vbList = this.vbDao.GetAllOrderField("TenVanBan", true);
            //view.VanBanList = this.vbList;
        }

        public void GetFunctionsNotOfGroup(String groupID)
        {
            view.DiaBanList = this.dbDao.GetFieldEqualCriteria("TrangThai", true);
        }

    }
}
